package application.view.viewComponent 
{
	import application.model.VO.ModuleVO;
	import flash.display.DisplayObject;
	import flash.display.Loader;
	import caurina.transitions.Tweener;
	/**
	 * ...
	 * @author Ning
	 */
	public class ModuleView extends LayoutView
	{
		private var _data:ModuleVO;
		private var _curView:DisplayObject;
		public function get moduleWidth():Number {
			return _data.width;
		}
		public function ModuleView() 
		{
			
		}
		public function updateData(data:ModuleVO):void
		{
			_data = data;
			updateLayout(data.layout);
		}
		public function showByName(name:String):void
		{
			if (_curView) {
				if (contains(_curView))
				    removeChild(_curView);
			}
			_curView = AppGlobal.RESOURES_POOL.getDisplayObjectLoader(name) as DisplayObject;

			if (_curView) {
			    addChild(_curView);
				_curView.alpha = 0;
				Tweener.addTween(_curView, {time:1,alpha:1 } );
			}
		}
	}

}